.class public Lcom/netease/newsreader/view/VoteDotIndicator;
.super Lcom/netease/newsreader/view/Indicator;
.source "VoteDotIndicator.java"


# static fields
.field private static final TAG:Ljava/lang/String; = "SlideDotIndicator"


# instance fields
.field private mIsShowNum:Z


# direct methods
.method public constructor <init>(Landroid/content/Context;)V
    .locals 1
    .parameter "context"

    .prologue
    .line 33
    invoke-direct {p0, p1}, Lcom/netease/newsreader/view/Indicator;-><init>(Landroid/content/Context;)V

    .line 25
    const/4 v0, 0x0

    iput-boolean v0, p0, Lcom/netease/newsreader/view/VoteDotIndicator;->mIsShowNum:Z

    .line 34
    invoke-direct {p0, p1}, Lcom/netease/newsreader/view/VoteDotIndicator;->init(Landroid/content/Context;)V

    .line 35
    return-void
.end method

.method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;)V
    .locals 1
    .parameter "context"
    .parameter "attrs"

    .prologue
    .line 28
    invoke-direct {p0, p1, p2}, Lcom/netease/newsreader/view/Indicator;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;)V

    .line 25
    const/4 v0, 0x0

    iput-boolean v0, p0, Lcom/netease/newsreader/view/VoteDotIndicator;->mIsShowNum:Z

    .line 29
    invoke-direct {p0, p1}, Lcom/netease/newsreader/view/VoteDotIndicator;->init(Landroid/content/Context;)V

    .line 30
    return-void
.end method

.method private init(Landroid/content/Context;)V
    .locals 0
    .parameter "context"

    .prologue
    .line 38
    return-void
.end method


# virtual methods
.method public onSetCurrentItem()V
    .locals 6

    .prologue
    .line 70
    invoke-virtual {p0}, Lcom/netease/newsreader/view/VoteDotIndicator;->getChildCount()I

    move-result v0

    .line 71
    .local v0, count:I
    const/4 v3, 0x0

    .local v3, i:I
    :goto_0
    if-lt v3, v0, :cond_1

    .line 80
    invoke-virtual {p0}, Lcom/netease/newsreader/view/VoteDotIndicator;->getCurrentItem()I

    move-result v1

    .line 81
    .local v1, currentItem:I
    if-ltz v1, :cond_0

    if-lt v1, v0, :cond_3

    .line 91
    :cond_0
    :goto_1
    return-void

    .line 72
    .end local v1           #currentItem:I
    :cond_1
    invoke-virtual {p0, v3}, Lcom/netease/newsreader/view/VoteDotIndicator;->getChildAt(I)Landroid/view/View;

    move-result-object v4

    check-cast v4, Lcom/netease/newsreader/view/DotIndicatorItem;

    .line 73
    .local v4, item:Lcom/netease/newsreader/view/DotIndicatorItem;
    iget-boolean v5, p0, Lcom/netease/newsreader/view/VoteDotIndicator;->mIsShowNum:Z

    if-eqz v5, :cond_2

    .line 74
    invoke-virtual {v4}, Lcom/netease/newsreader/view/DotIndicatorItem;->resetNum()V

    .line 76
    :cond_2
    invoke-virtual {v4}, Lcom/netease/newsreader/view/DotIndicatorItem;->getDrawable()Landroid/graphics/drawable/Drawable;

    move-result-object v2

    check-cast v2, Landroid/graphics/drawable/TransitionDrawable;

    .line 77
    .local v2, drawable:Landroid/graphics/drawable/TransitionDrawable;
    invoke-virtual {v2}, Landroid/graphics/drawable/TransitionDrawable;->resetTransition()V

    .line 71
    add-int/lit8 v3, v3, 0x1

    goto :goto_0

    .line 85
    .end local v2           #drawable:Landroid/graphics/drawable/TransitionDrawable;
    .end local v4           #item:Lcom/netease/newsreader/view/DotIndicatorItem;
    .restart local v1       #currentItem:I
    :cond_3
    invoke-virtual {p0, v1}, Lcom/netease/newsreader/view/VoteDotIndicator;->getChildAt(I)Landroid/view/View;

    move-result-object v4

    check-cast v4, Lcom/netease/newsreader/view/DotIndicatorItem;

    .line 86
    .restart local v4       #item:Lcom/netease/newsreader/view/DotIndicatorItem;
    iget-boolean v5, p0, Lcom/netease/newsreader/view/VoteDotIndicator;->mIsShowNum:Z

    if-eqz v5, :cond_4

    .line 87
    invoke-virtual {v4, v1}, Lcom/netease/newsreader/view/DotIndicatorItem;->setNum(I)V

    .line 89
    :cond_4
    invoke-virtual {v4}, Lcom/netease/newsreader/view/DotIndicatorItem;->getDrawable()Landroid/graphics/drawable/Drawable;

    move-result-object v2

    check-cast v2, Landroid/graphics/drawable/TransitionDrawable;

    .line 90
    .restart local v2       #drawable:Landroid/graphics/drawable/TransitionDrawable;
    const/16 v5, 0x32

    invoke-virtual {v2, v5}, Landroid/graphics/drawable/TransitionDrawable;->startTransition(I)V

    goto :goto_1
.end method

.method public onSetTotalItems()V
    .locals 11

    .prologue
    const/4 v10, -0x2

    .line 41
    invoke-virtual {p0}, Lcom/netease/newsreader/view/VoteDotIndicator;->detachAllViewsFromParent()V

    .line 43
    invoke-virtual {p0}, Lcom/netease/newsreader/view/VoteDotIndicator;->getTotalItems()I

    move-result v7

    .line 44
    .local v7, totalItems:I
    if-gtz v7, :cond_1

    .line 67
    :cond_0
    return-void

    .line 48
    :cond_1
    invoke-virtual {p0}, Lcom/netease/newsreader/view/VoteDotIndicator;->getContext()Landroid/content/Context;

    move-result-object v8

    invoke-static {v8}, Landroid/view/LayoutInflater;->from(Landroid/content/Context;)Landroid/view/LayoutInflater;

    move-result-object v3

    .line 49
    .local v3, inflater:Landroid/view/LayoutInflater;
    invoke-virtual {p0}, Lcom/netease/newsreader/view/VoteDotIndicator;->getContext()Landroid/content/Context;

    move-result-object v0

    .line 50
    .local v0, context:Landroid/content/Context;
    invoke-static {v0}, Lcom/netease/newsreader/util/ThemeSettingsHelper;->getThemeSettingsHelper(Landroid/content/Context;)Lcom/netease/newsreader/util/ThemeSettingsHelper;

    move-result-object v6

    .line 52
    .local v6, themeSettingsHelper:Lcom/netease/newsreader/util/ThemeSettingsHelper;
    const/4 v2, 0x0

    .local v2, i:I
    :goto_0
    if-ge v2, v7, :cond_0

    .line 53
    const v8, 0x7f030073

    .line 54
    const/4 v9, 0x0

    .line 53
    invoke-virtual {v3, v8, v9}, Landroid/view/LayoutInflater;->inflate(ILandroid/view/ViewGroup;)Landroid/view/View;

    move-result-object v1

    check-cast v1, Lcom/netease/newsreader/view/DotIndicatorItem;

    .line 55
    .local v1, dot:Lcom/netease/newsreader/view/DotIndicatorItem;
    if-nez v2, :cond_2

    .line 56
    const v8, 0x7f02003f

    invoke-virtual {v6, v0, v1, v8}, Lcom/netease/newsreader/util/ThemeSettingsHelper;->setImageViewSrc(Landroid/content/Context;Landroid/widget/ImageView;I)V

    .line 60
    :goto_1
    invoke-virtual {v1}, Lcom/netease/newsreader/view/DotIndicatorItem;->getDrawable()Landroid/graphics/drawable/Drawable;

    move-result-object v5

    check-cast v5, Landroid/graphics/drawable/TransitionDrawable;

    .line 61
    .local v5, td:Landroid/graphics/drawable/TransitionDrawable;
    const/4 v8, 0x1

    invoke-virtual {v5, v8}, Landroid/graphics/drawable/TransitionDrawable;->setCrossFadeEnabled(Z)V

    .line 62
    new-instance v4, Landroid/widget/LinearLayout$LayoutParams;

    invoke-direct {v4, v10, v10}, Landroid/widget/LinearLayout$LayoutParams;-><init>(II)V

    .line 65
    .local v4, p:Landroid/widget/LinearLayout$LayoutParams;
    invoke-virtual {p0, v1, v4}, Lcom/netease/newsreader/view/VoteDotIndicator;->addView(Landroid/view/View;Landroid/view/ViewGroup$LayoutParams;)V

    .line 52
    add-int/lit8 v2, v2, 0x1

    goto :goto_0

    .line 58
    .end local v4           #p:Landroid/widget/LinearLayout$LayoutParams;
    .end local v5           #td:Landroid/graphics/drawable/TransitionDrawable;
    :cond_2
    const v8, 0x7f02010e

    invoke-virtual {v6, v0, v1, v8}, Lcom/netease/newsreader/util/ThemeSettingsHelper;->setImageViewSrc(Landroid/content/Context;Landroid/widget/ImageView;I)V

    goto :goto_1
.end method

.method public setIndicatorBg(Landroid/content/Context;Lcom/netease/newsreader/util/ThemeSettingsHelper;)V
    .locals 4
    .parameter "context"
    .parameter "themeSettingsHelper"

    .prologue
    .line 96
    invoke-virtual {p0}, Lcom/netease/newsreader/view/VoteDotIndicator;->getChildCount()I

    move-result v0

    .line 97
    .local v0, count:I
    const/4 v1, 0x0

    .local v1, i:I
    :goto_0
    if-lt v1, v0, :cond_0

    .line 107
    invoke-virtual {p0}, Lcom/netease/newsreader/view/VoteDotIndicator;->onSetCurrentItem()V

    .line 108
    return-void

    .line 98
    :cond_0
    invoke-virtual {p0, v1}, Lcom/netease/newsreader/view/VoteDotIndicator;->getChildAt(I)Landroid/view/View;

    move-result-object v2

    check-cast v2, Lcom/netease/newsreader/view/DotIndicatorItem;

    .line 99
    .local v2, item:Lcom/netease/newsreader/view/DotIndicatorItem;
    const/4 v3, 0x0

    invoke-virtual {v2, v3}, Lcom/netease/newsreader/view/DotIndicatorItem;->setImageDrawable(Landroid/graphics/drawable/Drawable;)V

    .line 100
    if-nez v1, :cond_1

    .line 101
    const v3, 0x7f02003f

    invoke-virtual {p2, p1, v2, v3}, Lcom/netease/newsreader/util/ThemeSettingsHelper;->setImageViewSrc(Landroid/content/Context;Landroid/widget/ImageView;I)V

    .line 97
    :goto_1
    add-int/lit8 v1, v1, 0x1

    goto :goto_0

    .line 103
    :cond_1
    const v3, 0x7f02010e

    invoke-virtual {p2, p1, v2, v3}, Lcom/netease/newsreader/util/ThemeSettingsHelper;->setImageViewSrc(Landroid/content/Context;Landroid/widget/ImageView;I)V

    goto :goto_1
.end method
